
 CALL uvse_ExistsOrCreate('PAR_ACTIVITE');


 INSERT INTO se_par_activite
 (SELECT ID activite_cod,
         NULL cptjov_cod,
         NULL sectcial_cod,
         NULL refe_cod,
         NULL refe_ind,
         NULL enreg_id,
         NULL percomm_cod,
         NULL naturepiece_cod,
         NULL cptjoa_cod,
         'N' enreg_s,
         activite activite_lib,
         NULL activite_lib2,
         NULL critlibre1_val,
         NULL critlibre2_val,
         NULL critlibre3_val,
         NULL critlibre4_val
    FROM uv_pactivites_four) ;

 UPDATE se_par_activite tf SET enreg_id=(select enreg_id FROM erp_mli2.par_activite f WHERE f.activite_cod=tf.activite_cod) ;
 UPDATE se_par_activite tf SET enreg_id=outils_mli2.enreg_id.NEXTVAL WHERE enreg_id IS NULL;

 /*SELECT * FROM se_par_activite*/
 /*select * from erp_mli2.par_activite*/

 CALL uvse_synchroverserp('enreg_id','PAR_ACTIVITE','O') ;

 commit;






